let app = getApp();
import { IndexgetMiniPlate } from "../../api";
import { baseImgUrl, programTitle } from "../../setting";
Page({
  data: {
    baseurl_img: baseImgUrl,
    titleBarHeight: "",
    statusBarHeight: "",
    care_list: {},
    super_list: {},
    swiper_list: {},
    care_goods_list: {}
  },
  onLoad() {
    my.hideBackHome();
    const { titleBarHeight, statusBarHeight } = my.getSystemInfoSync();
    this.setData({
      titleBarHeight,
      statusBarHeight,
    });
    my.setNavigationBar({ frontColor: "#ffffff", backgroundColor: "#ffffff" });
  },
  async get_IndexgetMiniPlate() {
    const that = this;
    const res = await IndexgetMiniPlate({
      group: "care",
    });
    if (res) {
      console.log(res)
      res.forEach((item) => {
        if (item.key === "care_words") {
          // 严选热词
          this.setData({
            care_list: item,
          });
        }
        if (item.key === "super_cost") {
          // 严选热词
          this.setData({
            super_list: item,
          });
        }
        if (item.key === "care_recommend") {
          // 严选热词
          this.setData({
            swiper_list: item,
          });
        }
        if (item.key === "care_goods") {
          // 严选热词
          this.setData({
            care_goods_list: item,
          });
        }
       
      });
    }
  },

  onShow() {
    this.get_IndexgetMiniPlate();
  },
});
